<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--360浏览器优先以webkit内核解析-->
    <title> - 主页示例</title>
    <link rel="shortcut icon" href="assets/manager/favicon.ico"> 
    <link href="assets/manager/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="assets/manager/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="assets/manager/css/animate.css" rel="stylesheet">
    <link href="assets/manager/css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div><h2 class="crumbs">密码修改</h2></div>
        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins p10">
                    <div class="form-group">
                        	新密码：
                        <input style="width:250px" id="password" type="password" name="phone" placeholder="新密码,字母开头6-18位数字字母组合">
                    </div>
                    <div class="form-group">
                        	确认密码：
                        <input style="width:250px" id="cpassword" type="password" name="phone" placeholder="确认密码,字母开头6-18位数字字母组合">
                    </div>
                    <button class="btn btn-primary" id="edit" type="submit">修改</button>
                    <button class="btn btn-white" type="submit">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <script src="assets/manager/js/jquery.min.js?v=2.1.4"></script>
    <script src="assets/manager/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="assets/manager/js/plugins/layer/layer.min.js"></script>
    <!-- Flot -->
    <script src="assets/manager/js/plugins/flot/jquery.flot.js"></script>
    <script src="assets/manager/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="assets/manager/js/plugins/flot/jquery.flot.resize.js"></script>
    <script src="assets/manager/js/plugins/flot/jquery.flot.pie.js"></script>
    <!-- 自定义js -->
    <script src="assets/manager/js/content.js"></script>
    <!--flotdemo-->
	<script type="text/javascript">
		//修改userPW
		$("#edit").click(function() {
			if($("#password").val() != $("#cpassword").val()){
				alert("两次密码不一样！");
			}else{
				register();
			}
		});
		function register() {
			$dataObject = {
				password:$("#password").val()
			}

			$.ajax({
				type : "post",
				url : "edituserPW",
				dataType : "json",
				contentType : "application/json;charset=utf-8",
				data : JSON.stringify($dataObject),
				success : function(data) {
					if (data.res == 1) {
						alert("修改成功！");
						$("input").val("");
					} else {
						alert(data.resMsg);
					}
				}
			})
		};
		//修改userPW
	</script>
</body>
</html>